 <div class="modal fade" id="nuevaOferta" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
            <div class="modal-content" style="border-radius:0 !important;position:relative !important;">
                <form method='post' action='../logic/insertarOferta.php' onsubmit="return validarFormulario()">
                    <input type="hidden" name="pid" value="<?php echo $plan['idPlan']; ?>">
                    <!--<input type="hidden" name="uid" value="<?php // echo $plan['idUsuario'] ?>">-->
                <div class="aspa" data-dismiss="modal" aria-hidden="true" style="right:-10px;top:-10px;" title="Cerrar">
                    <i class="glyphicon glyphicon-remove"></i>
                </div>
                <div class="modal-header" style="color:white;background-color:#5789ae;color:white;border-bottom:black solid 2px;float:none;">
                    <div class="cartel" style="padding:0;margin:0;text-align:left;font-size:20px;">
                        Nueva Oferta
                    </div>
                </div>
                <div style="width:100%;height:100px;overflow:hidden;margin-bottom:0;border-bottom:black solid 2px">
                    <img style="width:100%" src="../<?php echo $plan['imagen']; ?>">
                </div>

                <div class="modal-body" style="padding-bottom:0">
                    <div style="width:100%;padding-bottom:10px;">
                        <div style="width:100%;font-weight:bold;">
                            <select class="input" name="rid">
                                <?php 
                                    $roles = obtenerRolesPlan($_POST['pid']);
                                    $z = 0;
                                    while ($z < count($roles)) { ?>
                                        <option value="<?php echo $roles[$z]['idRol'] ?>"><?php echo $roles[$z]['descripcionRol'] ?></option>
                                <?php 
                                    $z++;
                                    } 
                                ?>
                            </select>
                        </div>
                        <div style="width:100%;font-weight:bold;padding-top:10px;">
                            Comentario:
                            <input type="text" class="input" maxlength="130" name="comentario" id="comentario">
                        </div>
                        <div style="width:100%;font-weight:bold;padding-top:10px;">
                            Descripción:
                            <textarea class="input" maxlength="500" style="min-height:100px;" name="descripcion" id="descripcion"></textarea>
                        </div>
                        <div style="width:100%;font-weight:bold;padding-top:10px;">
                            <div style="float:left;padding-right:20px;">
                                <input type="checkbox" name="cerrada"> Privada  
                            </div>
                            <div style="float:left;padding-right:10px;">
                                <input type="checkbox" name="remunerado"> Remunerado
                            </div>
                            <div style="clear:both;"></div>
                        </div>
                    </div>
                     <div style="float:left;color:gray;font-size:11px;text-align:center;width:100%">
                        <?php if ( date("Y-m-d") < $plan['fecha'] ) { ?>
                            <?php echo "Comienza el ".formatoFecha($plan['fecha']) ?>
                        <?php } else { ?>
                           <font style="color:red;" title="Ya ha comenzado">
                                <i class='glyphicon glyphicon-warning-sign'></i> Comenzó el <?php echo formatoFecha($plan['fecha']) ?>
                           </font>
                        <?php } ?>
                    </div>
                </div>
                <div class="modal-footer" style="padding:10px;text-align:center">
                  <input type="submit" class="btn btn-info boton" value="Enviar">
                </div>
            </form>
        </div>
    </div>
</div>
<script>
    function validarFormulario() {
        campo = document.getElementById("comentario");
        if (campo.value == "") {
            campo.style.borderColor = "red";
            campo.style.boxShadow = "0px 0px 5px red";
            return false;
        } else {
            campo.style.borderColor = "silver";
            campo.style.boxShadow = "none";
        }
        campo = document.getElementById("descripcion");
        if (campo.value == "") {
            campo.style.borderColor = "red";
            campo.style.boxShadow = "0px 0px 5px red";
            return false;
        } else {
            campo.style.borderColor = "silver";
            campo.style.boxShadow = "none";
        }
        return true;
    }
</script>